package com.lollipop.synthential.java8.lambda.syntax.Exercise;

import java.util.ArrayList;
import java.util.Collections;

/**
 * @Author: J.K
 * @Date: 2021-02-15 22:05
 * @Description:
 */
public class Excise3 {
    public static void main(String[] args) {

        ArrayList<Integer> list = new ArrayList<>();

        Collections.addAll(list, 1, 2, 3, 4, 5, 6, 8, 0);

        // 遍历list
        list.forEach(System.out::println);

        // 输出集合中所有的偶数
        list.forEach(ele -> {
            if (ele % 2 == 0) {
                System.out.println(ele);
            }
        });
    }
}
